<?php

/**
 * Ubicacion form base class.
 *
 * @method Ubicacion getObject() Returns the current form's model object
 *
 * @package    KrazyTaxi
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseUbicacionForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IDUBICACION'     => new sfWidgetFormInputHidden(),
      'IDCALLE'         => new sfWidgetFormPropelChoice(array('model' => 'Calle', 'add_empty' => true)),
      'X'               => new sfWidgetFormInputText(),
      'Y'               => new sfWidgetFormInputText(),
      'NUMERODIRECCION' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'IDUBICACION'     => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdubicacion()), 'empty_value' => $this->getObject()->getIdubicacion(), 'required' => false)),
      'IDCALLE'         => new sfValidatorPropelChoice(array('model' => 'Calle', 'column' => 'IDCALLE', 'required' => false)),
      'X'               => new sfValidatorNumber(array('required' => false)),
      'Y'               => new sfValidatorNumber(array('required' => false)),
      'NUMERODIRECCION' => new sfValidatorString(array('max_length' => 10, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('ubicacion[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Ubicacion';
  }


}
